home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / wp / flex251x.zip / FLEX251 / FLEX.SKL < prev    next >
Text File  |  1995-10-30  |  33KB  |  1,494 lines

  1. /* A lexical scanner generated by flex */
  2.  
  3. /* Scanner skeleton version:
  4.  * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.81 95/03/20 14:02:24 vern Exp $
  5.  */
  6.  
  7. #define FLEX_SCANNER
  8. #define YY_FLEX_MAJOR_VERSION 2
  9. #define YY_FLEX_MINOR_VERSION 5
  10.  
  11. %-
  12. #include <stdio.h>
  13. %*
  14.  
  15.  
  16. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  17. #ifdef c_plusplus
  18. #ifndef __cplusplus
  19. #define __cplusplus
  20. #endif
  21. #endif
  22.  
  23.  
  24. #ifdef __cplusplus
  25.  
  26. #include <stdlib.h>
  27. %+
  28. class istream;
  29. %*
  30. #include <unistd.h>
  31.  
  32. /* Use prototypes in function declarations. */
  33. #define YY_USE_PROTOS
  34.  
  35. /* The "const" storage-class-modifier is valid. */
  36. #define YY_USE_CONST
  37.  
  38. #else    /* ! __cplusplus */
  39.  
  40. #if __STDC__
  41.  
  42. #define YY_USE_PROTOS
  43. #define YY_USE_CONST
  44.  
  45. #endif    /* __STDC__ */
  46. #endif    /* ! __cplusplus */
  47.  
  48. #ifdef __TURBOC__
  49.  #pragma warn -rch
  50.  #pragma warn -use
  51. #include <io.h>
  52. #include <stdlib.h>
  53. #define YY_USE_CONST
  54. #define YY_USE_PROTOS
  55. #endif
  56.  
  57. #ifndef YY_USE_CONST
  58. #ifndef const
  59. #define const
  60. #endif
  61. #endif
  62.  
  63.  
  64. #ifdef YY_USE_PROTOS
  65. #define YY_PROTO(proto) proto
  66. #else
  67. #define YY_PROTO(proto) ()
  68. #endif
  69.  
  70. /* Returned upon end-of-file. */
  71. #define YY_NULL 0
  72.  
  73. /* Promotes a possibly negative, possibly signed char to an unsigned
  74.  * integer for use as an array index.  If the signed char is negative,
  75.  * we want to instead treat it as an 8-bit unsigned char, hence the
  76.  * double cast.
  77.  */
  78. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  79.  
  80. /* Enter a start condition.  This macro really ought to take a parameter,
  81.  * but we do it the disgusting crufty way forced on us by the ()-less
  82.  * definition of BEGIN.
  83.  */
  84. #define BEGIN yy_start = 1 + 2 *
  85.  
  86. /* Translate the current start state into a value that can be later handed
  87.  * to BEGIN to return to the state.  The YYSTATE alias is for lex
  88.  * compatibility.
  89.  */
  90. #define YY_START ((yy_start - 1) / 2)
  91. #define YYSTATE YY_START
  92.  
  93. /* Action number for EOF rule of a given start state. */
  94. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  95.  
  96. /* Special action meaning "start processing a new file". */
  97. #define YY_NEW_FILE yyrestart( yyin )
  98.  
  99. #define YY_END_OF_BUFFER_CHAR 0
  100.  
  101. /* Size of default input buffer. */
  102. #define YY_BUF_SIZE 16384
  103.  
  104. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  105.  
  106. extern int yyleng;
  107. %-
  108. extern FILE *yyin, *yyout;
  109. %*
  110.  
  111. #define EOB_ACT_CONTINUE_SCAN 0
  112. #define EOB_ACT_END_OF_FILE 1
  113. #define EOB_ACT_LAST_MATCH 2
  114.  
  115. /* The funky do-while in the following #define is used to turn the definition
  116.  * int a single C statement (which needs a semi-colon terminator).  This
  117.  * avoids problems with code like:
  118.  *
  119.  *     if ( condition_holds )
  120.  *        yyless( 5 );
  121.  *    else
  122.  *        do_something_else();
  123.  *
  124.  * Prior to using the do-while the compiler would get upset at the
  125.  * "else" because it interpreted the "if" statement as being all
  126.  * done when it reached the ';' after the yyless() call.
  127.  */
  128.  
  129. /* Return all but the first 'n' matched characters back to the input stream. */
  130.  
  131. #define yyless(n) \
  132.     do \
  133.         { \
  134.         /* Undo effects of setting up yytext. */ \
  135.         *yy_cp = yy_hold_char; \
  136.         yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
  137.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  138.         } \
  139.     while ( 0 )
  140.  
  141. #define unput(c) yyunput( c, yytext_ptr )
  142.  
  143. /* The following is because we cannot portably get our hands on size_t
  144.  * (without autoconf's help, which isn't available because we want
  145.  * flex-generated scanners to compile on their own).
  146.  */
  147. typedef unsigned int yy_size_t;
  148.  
  149.  
  150. struct yy_buffer_state
  151.     {
  152. %-
  153.     FILE *yy_input_file;
  154. %+
  155.     istream* yy_input_file;
  156. %*
  157.  
  158.     char *yy_ch_buf;        /* input buffer */
  159.     char *yy_buf_pos;        /* current position in input buffer */
  160.  
  161.     /* Size of input buffer in bytes, not including room for EOB
  162.      * characters.
  163.      */
  164.     yy_size_t yy_buf_size;
  165.  
  166.     /* Number of characters read into yy_ch_buf, not including EOB
  167.      * characters.
  168.      */
  169.     int yy_n_chars;
  170.  
  171.     /* Whether we "own" the buffer - i.e., we know we created it,
  172.      * and can realloc() it to grow it, and should free() it to
  173.      * delete it.
  174.      */
  175.     int yy_is_our_buffer;
  176.  
  177.     /* Whether this is an "interactive" input source; if so, and
  178.      * if we're using stdio for input, then we want to use getc()
  179.      * instead of fread(), to make sure we stop fetching input after
  180.      * each newline.
  181.      */
  182.     int yy_is_interactive;
  183.  
  184.     /* Whether we're considered to be at the beginning of a line.
  185.      * If so, '^' rules will be active on the next match, otherwise
  186.      * not.
  187.      */
  188.     int yy_at_bol;
  189.  
  190.     /* Whether to try to fill the input buffer when we reach the
  191.      * end of it.
  192.      */
  193.     int yy_fill_buffer;
  194.  
  195.     int yy_buffer_status;
  196. #define YY_BUFFER_NEW 0
  197. #define YY_BUFFER_NORMAL 1
  198.     /* When an EOF's been seen but there's still some text to process
  199.      * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  200.      * shouldn't try reading from the input source any more.  We might
  201.      * still have a bunch of tokens to match, though, because of
  202.      * possible backing-up.
  203.      *
  204.      * When we actually see the EOF, we change the status to "new"
  205.      * (via yyrestart()), so that the user can continue scanning by
  206.      * just pointing yyin at a new input file.
  207.      */
  208. #define YY_BUFFER_EOF_PENDING 2
  209.     };
  210.  
  211. %- Standard (non-C++) definition
  212. static YY_BUFFER_STATE yy_current_buffer = 0;
  213. %*
  214.  
  215. /* We provide macros for accessing buffer states in case in the
  216.  * future we want to put the buffer states in a more general
  217.  * "scanner state".
  218.  */
  219. #define YY_CURRENT_BUFFER yy_current_buffer
  220.  
  221.  
  222. %- Standard (non-C++) definition
  223. /* yy_hold_char holds the character lost when yytext is formed. */
  224. static char yy_hold_char;
  225.  
  226. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  227.  
  228.  
  229. int yyleng;
  230.  
  231. /* Points to current character in buffer. */
  232. static char *yy_c_buf_p = (char *) 0;
  233. static int yy_init = 1;        /* whether we need to initialize */
  234. static int yy_start = 0;    /* start state number */
  235.  
  236. /* Flag which is used to allow yywrap()'s to do buffer switches
  237.  * instead of setting up a fresh yyin.  A bit of a hack ...
  238.  */
  239. static int yy_did_buffer_switch_on_eof;
  240.  
  241. void yyrestart YY_PROTO(( FILE *input_file ));
  242.  
  243. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  244. void yy_load_buffer_state YY_PROTO(( void ));
  245. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  246. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  247. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  248. void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  249. #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
  250.  
  251. YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
  252. YY_BUFFER_STATE yy_scan_string YY_PROTO(( const char *str ));
  253. YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( const char *bytes, int len ));
  254. %*
  255.  
  256. static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
  257. static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
  258. static void yy_flex_free YY_PROTO(( void * ));
  259.  
  260. #define yy_new_buffer yy_create_buffer
  261.  
  262. #define yy_set_interactive(is_interactive) \
  263.     { \
  264.     if ( ! yy_current_buffer ) \
  265.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  266.     yy_current_buffer->yy_is_interactive = is_interactive; \
  267.     }
  268.  
  269. #define yy_set_bol(at_bol) \
  270.     { \
  271.     if ( ! yy_current_buffer ) \
  272.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  273.     yy_current_buffer->yy_at_bol = at_bol; \
  274.     }
  275.  
  276. #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
  277.  
  278. %% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
  279.  
  280. #ifndef YY_SKIP_YYWRAP
  281. #ifdef __cplusplus
  282. extern "C" int yywrap YY_PROTO(( void ));
  283. #else
  284. extern int yywrap YY_PROTO(( void ));
  285. #endif
  286. #endif
  287.  
  288. #ifndef YY_NO_UNPUT
  289. static void yyunput YY_PROTO(( int c, char *buf_ptr ));
  290. #endif
  291.  
  292. #ifndef yytext_ptr
  293. static void yy_flex_strncpy YY_PROTO(( char *, const char *, int ));
  294. #endif
  295.  
  296. #ifndef YY_NO_INPUT
  297. %- Standard (non-C++) definition
  298. #ifdef __cplusplus
  299. static int yyinput YY_PROTO(( void ));
  300. #else
  301. static int input YY_PROTO(( void ));
  302. #endif
  303. %*
  304. #endif
  305.  
  306. %- Standard (non-C++) definition
  307. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  308. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  309. static int yy_get_next_buffer YY_PROTO(( void ));
  310. static void yy_fatal_error YY_PROTO(( const char msg[] ));
  311. %*
  312.  
  313. /* Done after the current pattern has been matched and before the
  314.  * corresponding action - sets up yytext.
  315.  */
  316. #define YY_DO_BEFORE_ACTION \
  317.     yytext_ptr = yy_bp; \
  318. %% code to fiddle yytext and yyleng for yymore() goes here
  319.     yy_hold_char = *yy_cp; \
  320.     *yy_cp = '\0'; \
  321. %% code to copy yytext_ptr to yytext[] goes here, if %array
  322.     yy_c_buf_p = yy_cp;
  323.  
  324. %% data tables for the DFA and the user's section 1 definitions go here
  325.  
  326. /* Macros after this point can all be overridden by user definitions in
  327.  * section 1.
  328.  */
  329.  
  330. #if YY_STACK_USED
  331. static int yy_start_stack_ptr = 0;
  332. static int yy_start_stack_depth = 0;
  333. static int *yy_start_stack = 0;
  334. #ifndef YY_NO_PUSH_STATE
  335. static void yy_push_state YY_PROTO(( int new_state ));
  336. #endif
  337. #ifndef YY_NO_POP_STATE
  338. static void yy_pop_state YY_PROTO(( void ));
  339. #endif
  340. #ifndef YY_NO_TOP_STATE
  341. static int yy_top_state YY_PROTO(( void ));
  342. #endif
  343.  
  344. #else
  345. #define YY_NO_PUSH_STATE 1
  346. #define YY_NO_POP_STATE 1
  347. #define YY_NO_TOP_STATE 1
  348. #endif
  349.  
  350. #ifdef YY_MALLOC_DECL
  351. YY_MALLOC_DECL
  352. #else
  353. #if __STDC__
  354. #ifndef __cplusplus
  355. #include <stdlib.h>
  356. #endif
  357. #else
  358. /* Just try to get by without declaring the routines.  This will fail
  359.  * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
  360.  * or sizeof(void*) != sizeof(int).
  361.  */
  362. #endif
  363. #endif
  364.  
  365. /* Amount of stuff to slurp up with each read. */
  366. #ifndef YY_READ_BUF_SIZE
  367. #define YY_READ_BUF_SIZE 8192
  368. #endif
  369.  
  370. /* Copy whatever the last rule matched to the standard output. */
  371.  
  372. #ifndef ECHO
  373. %- Standard (non-C++) definition
  374. /* This used to be an fputs(), but since the string might contain NUL's,
  375.  * we now use fwrite().
  376.  */
  377. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  378. %+ C++ definition
  379. #define ECHO LexerOutput( yytext, yyleng )
  380. %*
  381. #endif
  382.  
  383. /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  384.  * is returned in "result".
  385.  */
  386. #ifndef YY_INPUT
  387. #define YY_INPUT(buf,result,max_size) \
  388. %% fread()/read() definition of YY_INPUT goes here unless we're doing C++
  389. %+ C++ definition
  390.     if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
  391.         YY_FATAL_ERROR( "input in flex scanner failed" );
  392. %*
  393. #endif
  394.  
  395. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  396.  * we don't want an extra ';' after the "return" because that will cause
  397.  * some compilers to complain about unreachable statements.
  398.  */
  399. #ifndef yyterminate
  400. #define yyterminate() return YY_NULL
  401. #endif
  402.  
  403. /* Number of entries by which start-condition stack grows. */
  404. #ifndef YY_START_STACK_INCR
  405. #define YY_START_STACK_INCR 25
  406. #endif
  407.  
  408. /* Report a fatal error. */
  409. #ifndef YY_FATAL_ERROR
  410. %-
  411. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  412. %+
  413. #define YY_FATAL_ERROR(msg) LexerError( msg )
  414. %*
  415. #endif
  416.  
  417. /* Default declaration of generated scanner - a define so the user can
  418.  * easily add parameters.
  419.  */
  420. #ifndef YY_DECL
  421. %- Standard (non-C++) definition
  422. #define YY_DECL int yylex YY_PROTO(( void ))
  423. %+ C++ definition
  424. #define YY_DECL int yyFlexLexer::yylex()
  425. %*
  426. #endif
  427.  
  428. /* Code executed at the beginning of each rule, after yytext and yyleng
  429.  * have been set up.
  430.  */
  431. #ifndef YY_USER_ACTION
  432. #define YY_USER_ACTION
  433. #endif
  434.  
  435. /* Code executed at the end of each rule. */
  436. #ifndef YY_BREAK
  437. #define YY_BREAK break;
  438. #endif
  439.  
  440. %% YY_RULE_SETUP definition goes here
  441.  
  442. YY_DECL
  443.     {
  444.     register yy_state_type yy_current_state;
  445.     register char *yy_cp, *yy_bp;
  446.     register int yy_act;
  447.  
  448. %% user's declarations go here
  449.  
  450.     if ( yy_init )
  451.         {
  452.         yy_init = 0;
  453.  
  454. #ifdef YY_USER_INIT
  455.         YY_USER_INIT;
  456. #endif
  457.  
  458.         if ( ! yy_start )
  459.             yy_start = 1;    /* first start state */
  460.  
  461.         if ( ! yyin )
  462. %-
  463.             yyin = stdin;
  464. %+
  465.             yyin = &cin;
  466. %*
  467.  
  468.         if ( ! yyout )
  469. %-
  470.             yyout = stdout;
  471. %+
  472.             yyout = &cout;
  473. %*
  474.  
  475.         if ( ! yy_current_buffer )
  476.             yy_current_buffer =
  477.                 yy_create_buffer( yyin, YY_BUF_SIZE );
  478.  
  479.         yy_load_buffer_state();
  480.         }
  481.  
  482.     while ( 1 )        /* loops until end-of-file is reached */
  483.         {
  484. %% yymore()-related code goes here
  485.         yy_cp = yy_c_buf_p;
  486.  
  487.         /* Support of yytext. */
  488.         *yy_cp = yy_hold_char;
  489.  
  490.         /* yy_bp points to the position in yy_ch_buf of the start of
  491.          * the current run.
  492.          */
  493.         yy_bp = yy_cp;
  494.  
  495. %% code to set up and find next match goes here
  496.  
  497. yy_find_action:
  498. %% code to find the action number goes here
  499.  
  500.         YY_DO_BEFORE_ACTION;
  501.  
  502. %% code for yylineno update goes here
  503.  
  504. do_action:    /* This label is used only to access EOF actions. */
  505.  
  506. %% debug code goes here
  507.  
  508.         switch ( yy_act )
  509.     { /* beginning of action switch */
  510. %% actions go here
  511.  
  512.     case YY_END_OF_BUFFER:
  513.         {
  514.         /* Amount of text matched not including the EOB char. */
  515.         int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
  516.  
  517.         /* Undo the effects of YY_DO_BEFORE_ACTION. */
  518.         *yy_cp = yy_hold_char;
  519.  
  520.         if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
  521.             {
  522.             /* We're scanning a new file or input source.  It's
  523.              * possible that this happened because the user
  524.              * just pointed yyin at a new source and called
  525.              * yylex().  If so, then we have to assure
  526.              * consistency between yy_current_buffer and our
  527.              * globals.  Here is the right place to do so, because
  528.              * this is the first action (other than possibly a
  529.              * back-up) that will match for the new input source.
  530.              */
  531.             yy_n_chars = yy_current_buffer->yy_n_chars;
  532.             yy_current_buffer->yy_input_file = yyin;
  533.             yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
  534.             }
  535.  
  536.         /* Note that here we test for yy_c_buf_p "<=" to the position
  537.          * of the first EOB in the buffer, since yy_c_buf_p will
  538.          * already have been incremented past the NUL character
  539.          * (since all states make transitions on EOB to the
  540.          * end-of-buffer state).  Contrast this with the test
  541.          * in input().
  542.          */
  543.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  544.             { /* This was really a NUL. */
  545.             yy_state_type yy_next_state;
  546.  
  547.             yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
  548.  
  549.             yy_current_state = yy_get_previous_state();
  550.  
  551.             /* Okay, we're now positioned to make the NUL
  552.              * transition.  We couldn't have
  553.              * yy_get_previous_state() go ahead and do it
  554.              * for us because it doesn't know how to deal
  555.              * with the possibility of jamming (and we don't
  556.              * want to build jamming into it because then it
  557.              * will run more slowly).
  558.              */
  559.  
  560.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  561.  
  562.             yy_bp = yytext_ptr + YY_MORE_ADJ;
  563.  
  564.             if ( yy_next_state )
  565.                 {
  566.                 /* Consume the NUL. */
  567.                 yy_cp = ++yy_c_buf_p;
  568.                 yy_current_state = yy_next_state;
  569.                 goto yy_match;
  570.                 }
  571.  
  572.             else
  573.                 {
  574. %% code to do back-up for compressed tables and set up yy_cp goes here
  575.                 goto yy_find_action;
  576.                 }
  577.             }
  578.  
  579.         else switch ( yy_get_next_buffer() )
  580.             {
  581.             case EOB_ACT_END_OF_FILE:
  582.                 {
  583.                 yy_did_buffer_switch_on_eof = 0;
  584.  
  585.                 if ( yywrap() )
  586.                     {
  587.                     /* Note: because we've taken care in
  588.                      * yy_get_next_buffer() to have set up
  589.                      * yytext, we can now set up
  590.                      * yy_c_buf_p so that if some total
  591.                      * hoser (like flex itself) wants to
  592.                      * call the scanner after we return the
  593.                      * YY_NULL, it'll still work - another
  594.                      * YY_NULL will get returned.
  595.                      */
  596.                     yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
  597.  
  598.                     yy_act = YY_STATE_EOF(YY_START);
  599.                     goto do_action;
  600.                     }
  601.  
  602.                 else
  603.                     {
  604.                     if ( ! yy_did_buffer_switch_on_eof )
  605.                         YY_NEW_FILE;
  606.                     }
  607.                 break;
  608.                 }
  609.  
  610.             case EOB_ACT_CONTINUE_SCAN:
  611.                 yy_c_buf_p =
  612.                     yytext_ptr + yy_amount_of_matched_text;
  613.  
  614.                 yy_current_state = yy_get_previous_state();
  615.  
  616.                 yy_cp = yy_c_buf_p;
  617.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  618.                 goto yy_match;
  619.  
  620.             case EOB_ACT_LAST_MATCH:
  621.                 yy_c_buf_p =
  622.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  623.  
  624.                 yy_current_state = yy_get_previous_state();
  625.  
  626.                 yy_cp = yy_c_buf_p;
  627.                 yy_bp = yytext_ptr + YY_MORE_ADJ;
  628.                 goto yy_find_action;
  629.             }
  630.         break;
  631.         }
  632.  
  633.     default:
  634.         YY_FATAL_ERROR(
  635.             "fatal flex scanner internal error--no action found" );
  636.     } /* end of action switch */
  637.         } /* end of scanning one token */
  638.     } /* end of yylex */
  639.  
  640. %+
  641. yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
  642.     {
  643.     yyin = arg_yyin;
  644.     yyout = arg_yyout;
  645.     yy_c_buf_p = 0;
  646.     yy_init = 1;
  647.     yy_start = 0;
  648.     yy_flex_debug = 0;
  649.     yylineno = 1;    // this will only get updated if %option yylineno
  650.  
  651.     yy_did_buffer_switch_on_eof = 0;
  652.  
  653.     yy_looking_for_trail_begin = 0;
  654.     yy_more_flag = 0;
  655.     yy_more_len = 0;
  656.  
  657.     yy_start_stack_ptr = yy_start_stack_depth = 0;
  658.     yy_start_stack = 0;
  659.  
  660.     yy_current_buffer = 0;
  661.  
  662. #ifdef YY_USES_REJECT
  663.     yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2];
  664. #else
  665.     yy_state_buf = 0;
  666. #endif
  667.     }
  668.  
  669. yyFlexLexer::~yyFlexLexer()
  670.     {
  671.     delete yy_state_buf;
  672.     yy_delete_buffer( yy_current_buffer );
  673.     }
  674.  
  675. void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
  676.     {
  677.     if ( new_in )
  678.         {
  679.         yy_delete_buffer( yy_current_buffer );
  680.         yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
  681.         }
  682.  
  683.     if ( new_out )
  684.         yyout = new_out;
  685.     }
  686.  
  687. #ifdef YY_INTERACTIVE
  688. int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
  689. #else
  690. int yyFlexLexer::LexerInput( char* buf, int max_size )
  691. #endif
  692.     {
  693.     if ( yyin->eof() || yyin->fail() )
  694.         return 0;
  695.  
  696. #ifdef YY_INTERACTIVE
  697.     yyin->get( buf[0] );
  698.  
  699.     if ( yyin->eof() )
  700.         return 0;
  701.  
  702.     if ( yyin->bad() )
  703.         return -1;
  704.  
  705.     return 1;
  706.  
  707. #else
  708.     (void) yyin->read( buf, max_size );
  709.  
  710.     if ( yyin->bad() )
  711.         return -1;
  712.     else
  713.         return yyin->gcount();
  714. #endif
  715.     }
  716.  
  717. void yyFlexLexer::LexerOutput( const char* buf, int size )
  718.     {
  719.     (void) yyout->write( buf, size );
  720.     }
  721. %*
  722.  
  723. /* yy_get_next_buffer - try to read in a new buffer
  724.  *
  725.  * Returns a code representing an action:
  726.  *    EOB_ACT_LAST_MATCH -
  727.  *    EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  728.  *    EOB_ACT_END_OF_FILE - end of file
  729.  */
  730.  
  731. %-
  732. static int yy_get_next_buffer()
  733. %+
  734. int yyFlexLexer::yy_get_next_buffer()
  735. %*
  736.     {
  737.     register char *dest = yy_current_buffer->yy_ch_buf;
  738.     register char *source = yytext_ptr;
  739.     register int number_to_move, i;
  740.     int ret_val;
  741.  
  742.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  743.         YY_FATAL_ERROR(
  744.         "fatal flex scanner internal error--end of buffer missed" );
  745.  
  746.     if ( yy_current_buffer->yy_fill_buffer == 0 )
  747.         { /* Don't try to fill the buffer, so this is an EOF. */
  748.         if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
  749.             {
  750.             /* We matched a singled characater, the EOB, so
  751.              * treat this as a final EOF.
  752.              */
  753.             return EOB_ACT_END_OF_FILE;
  754.             }
  755.  
  756.         else
  757.             {
  758.             /* We matched some text prior to the EOB, first
  759.              * process it.
  760.              */
  761.             return EOB_ACT_LAST_MATCH;
  762.             }
  763.         }
  764.  
  765.     /* Try to read more data. */
  766.  
  767.     /* First move last chars to start of buffer. */
  768.     number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
  769.  
  770.     for ( i = 0; i < number_to_move; ++i )
  771.         *(dest++) = *(source++);
  772.  
  773.     if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  774.         /* don't do the read, it's not guaranteed to return an EOF,
  775.          * just force an EOF
  776.          */
  777.         yy_n_chars = 0;
  778.  
  779.     else
  780.         {
  781.         int num_to_read =
  782.             yy_current_buffer->yy_buf_size - number_to_move - 1;
  783.  
  784.         while ( num_to_read <= 0 )
  785.             { /* Not enough room in the buffer - grow it. */
  786. #ifdef YY_USES_REJECT
  787.             YY_FATAL_ERROR(
  788. "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
  789. #else
  790.  
  791.             /* just a shorter name for the current buffer */
  792.             YY_BUFFER_STATE b = yy_current_buffer;
  793.  
  794.             int yy_c_buf_p_offset =
  795.                 (int) (yy_c_buf_p - b->yy_ch_buf);
  796.  
  797.             if ( b->yy_is_our_buffer )
  798.                 {
  799.                 int new_size = b->yy_buf_size * 2;
  800.  
  801.                 if ( new_size <= 0 )
  802.                     b->yy_buf_size += b->yy_buf_size / 8;
  803.                 else
  804.                     b->yy_buf_size *= 2;
  805.  
  806.                 b->yy_ch_buf = (char *)
  807.                     /* Include room in for 2 EOB chars. */
  808.                     yy_flex_realloc( (void *) b->yy_ch_buf,
  809.                              b->yy_buf_size + 2 );
  810.                 }
  811.             else
  812.                 /* Can't grow it, we don't own it. */
  813.                 b->yy_ch_buf = 0;
  814.  
  815.             if ( ! b->yy_ch_buf )
  816.                 YY_FATAL_ERROR(
  817.                 "fatal error - scanner input buffer overflow" );
  818.  
  819.             yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  820.  
  821.             num_to_read = yy_current_buffer->yy_buf_size -
  822.                         number_to_move - 1;
  823. #endif
  824.             }
  825.  
  826.         if ( num_to_read > YY_READ_BUF_SIZE )
  827.             num_to_read = YY_READ_BUF_SIZE;
  828.  
  829.         /* Read in more data. */
  830.         YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  831.             yy_n_chars, num_to_read );
  832.         }
  833.  
  834.     if ( yy_n_chars == 0 )
  835.         {
  836.         if ( number_to_move == YY_MORE_ADJ )
  837.             {
  838.             ret_val = EOB_ACT_END_OF_FILE;
  839.             yyrestart( yyin );
  840.             }
  841.  
  842.         else
  843.             {
  844.             ret_val = EOB_ACT_LAST_MATCH;
  845.             yy_current_buffer->yy_buffer_status =
  846.                 YY_BUFFER_EOF_PENDING;
  847.             }
  848.         }
  849.  
  850.     else
  851.         ret_val = EOB_ACT_CONTINUE_SCAN;
  852.  
  853.     yy_n_chars += number_to_move;
  854.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  855.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  856.  
  857.     yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
  858.  
  859.     return ret_val;
  860.     }
  861.  
  862.  
  863. /* yy_get_previous_state - get the state just before the EOB char was reached */
  864.  
  865. %-
  866. static yy_state_type yy_get_previous_state()
  867. %+
  868. yy_state_type yyFlexLexer::yy_get_previous_state()
  869. %*
  870.     {
  871.     register yy_state_type yy_current_state;
  872.     register char *yy_cp;
  873.  
  874. %% code to get the start state into yy_current_state goes here
  875.  
  876.     for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  877.         {
  878. %% code to find the next state goes here
  879.         }
  880.  
  881.     return yy_current_state;
  882.     }
  883.  
  884.  
  885. /* yy_try_NUL_trans - try to make a transition on the NUL character
  886.  *
  887.  * synopsis
  888.  *    next_state = yy_try_NUL_trans( current_state );
  889.  */
  890.  
  891. %-
  892. #ifdef YY_USE_PROTOS
  893. static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
  894. #else
  895. static yy_state_type yy_try_NUL_trans( yy_current_state )
  896. yy_state_type yy_current_state;
  897. #endif
  898. %+
  899. yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
  900. %*
  901.     {
  902.     register int yy_is_jam;
  903. %% code to find the next state, and perhaps do backing up, goes here
  904.  
  905.     return yy_is_jam ? 0 : yy_current_state;
  906.     }
  907.  
  908.  
  909. %-
  910. #ifdef YY_USE_PROTOS
  911. static void yyunput( int c, register char *yy_bp )
  912. #else
  913. static void yyunput( c, yy_bp )
  914. int c;
  915. register char *yy_bp;
  916. #endif
  917. %+
  918. void yyFlexLexer::yyunput( int c, register char* yy_bp )
  919. %*
  920.     {
  921.     register char *yy_cp = yy_c_buf_p;
  922.  
  923.     /* undo effects of setting up yytext */
  924.     *yy_cp = yy_hold_char;
  925.  
  926.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  927.         { /* need to shift things up to make room */
  928.         /* +2 for EOB chars. */
  929.         register int number_to_move = yy_n_chars + 2;
  930.         register char *dest = &yy_current_buffer->yy_ch_buf[
  931.                     yy_current_buffer->yy_buf_size + 2];
  932.         register char *source =
  933.                 &yy_current_buffer->yy_ch_buf[number_to_move];
  934.  
  935.         while ( source > yy_current_buffer->yy_ch_buf )
  936.             *--dest = *--source;
  937.  
  938.         yy_cp += (int) (dest - source);
  939.         yy_bp += (int) (dest - source);
  940.         yy_n_chars = yy_current_buffer->yy_buf_size;
  941.  
  942.         if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  943.             YY_FATAL_ERROR( "flex scanner push-back overflow" );
  944.         }
  945.  
  946.     *--yy_cp = (char) c;
  947.  
  948. %% update yylineno here
  949.  
  950.     yytext_ptr = yy_bp;
  951.     yy_hold_char = *yy_cp;
  952.     yy_c_buf_p = yy_cp;
  953.     }
  954.  
  955.  
  956. %-
  957. #ifdef __cplusplus
  958. static int yyinput()
  959. #else
  960. static int input()
  961. #endif
  962. %+
  963. int yyFlexLexer::yyinput()
  964. %*
  965.     {
  966.     int c;
  967.  
  968.     *yy_c_buf_p = yy_hold_char;
  969.  
  970.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  971.         {
  972.         /* yy_c_buf_p now points to the character we want to return.
  973.          * If this occurs *before* the EOB characters, then it's a
  974.          * valid NUL; if not, then we've hit the end of the buffer.
  975.          */
  976.         if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  977.             /* This was really a NUL. */
  978.             *yy_c_buf_p = '\0';
  979.  
  980.         else
  981.             { /* need more input */
  982.             yytext_ptr = yy_c_buf_p;
  983.             ++yy_c_buf_p;
  984.  
  985.             switch ( yy_get_next_buffer() )
  986.                 {
  987.                 case EOB_ACT_END_OF_FILE:
  988.                     {
  989.                     if ( yywrap() )
  990.                         {
  991.                         yy_c_buf_p =
  992.                         yytext_ptr + YY_MORE_ADJ;
  993.                         return EOF;
  994.                         }
  995.  
  996.                     if ( ! yy_did_buffer_switch_on_eof )
  997.                         YY_NEW_FILE;
  998. #ifdef __cplusplus
  999.                     return yyinput();
  1000. #else
  1001.                     return input();
  1002. #endif
  1003.                     }
  1004.  
  1005.                 case EOB_ACT_CONTINUE_SCAN:
  1006.                     yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
  1007.                     break;
  1008.  
  1009.                 case EOB_ACT_LAST_MATCH:
  1010. #ifdef __cplusplus
  1011.                     YY_FATAL_ERROR(
  1012.                     "unexpected last match in yyinput()" );
  1013. #else
  1014.                     YY_FATAL_ERROR(
  1015.                     "unexpected last match in input()" );
  1016. #endif
  1017.                 }
  1018.             }
  1019.         }
  1020.  
  1021.     c = *(unsigned char *) yy_c_buf_p;    /* cast for 8-bit char's */
  1022.     *yy_c_buf_p = '\0';    /* preserve yytext */
  1023.     yy_hold_char = *++yy_c_buf_p;
  1024.  
  1025. %% update BOL and yylineno
  1026.  
  1027.     return c;
  1028.     }
  1029.  
  1030.  
  1031. %-
  1032. #ifdef YY_USE_PROTOS
  1033. void yyrestart( FILE *input_file )
  1034. #else
  1035. void yyrestart( input_file )
  1036. FILE *input_file;
  1037. #endif
  1038. %+
  1039. void yyFlexLexer::yyrestart( istream* input_file )
  1040. %*
  1041.     {
  1042.     if ( ! yy_current_buffer )
  1043.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  1044.  
  1045.     yy_init_buffer( yy_current_buffer, input_file );
  1046.     yy_load_buffer_state();
  1047.     }
  1048.  
  1049.  
  1050. %-
  1051. #ifdef YY_USE_PROTOS
  1052. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1053. #else
  1054. void yy_switch_to_buffer( new_buffer )
  1055. YY_BUFFER_STATE new_buffer;
  1056. #endif
  1057. %+
  1058. void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1059. %*
  1060.     {
  1061.     if ( yy_current_buffer == new_buffer )
  1062.         return;
  1063.  
  1064.     if ( yy_current_buffer )
  1065.         {
  1066.         /* Flush out information for old buffer. */
  1067.         *yy_c_buf_p = yy_hold_char;
  1068.         yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1069.         yy_current_buffer->yy_n_chars = yy_n_chars;
  1070.         }
  1071.  
  1072.     yy_current_buffer = new_buffer;
  1073.     yy_load_buffer_state();
  1074.  
  1075.     /* We don't actually know whether we did this switch during
  1076.      * EOF (yywrap()) processing, but the only time this flag
  1077.      * is looked at is after yywrap() is called, so it's safe
  1078.      * to go ahead and always set it.
  1079.      */
  1080.     yy_did_buffer_switch_on_eof = 1;
  1081.     }
  1082.  
  1083.  
  1084. %-
  1085. #ifdef YY_USE_PROTOS
  1086. void yy_load_buffer_state( void )
  1087. #else
  1088. void yy_load_buffer_state()
  1089. #endif
  1090. %+
  1091. void yyFlexLexer::yy_load_buffer_state()
  1092. %*
  1093.     {
  1094.     yy_n_chars = yy_current_buffer->yy_n_chars;
  1095.     yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  1096.     yyin = yy_current_buffer->yy_input_file;
  1097.     yy_hold_char = *yy_c_buf_p;
  1098.     }
  1099.  
  1100.  
  1101. %-
  1102. #ifdef YY_USE_PROTOS
  1103. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  1104. #else
  1105. YY_BUFFER_STATE yy_create_buffer( file, size )
  1106. FILE *file;
  1107. int size;
  1108. #endif
  1109. %+
  1110. YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
  1111. %*
  1112.     {
  1113.     YY_BUFFER_STATE b;
  1114.  
  1115.     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  1116.     if ( ! b )
  1117.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1118.  
  1119.     b->yy_buf_size = size;
  1120.  
  1121.     /* yy_ch_buf has to be 2 characters longer than the size given because
  1122.      * we need to put in 2 end-of-buffer characters.
  1123.      */
  1124.     b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
  1125.     if ( ! b->yy_ch_buf )
  1126.         YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1127.  
  1128.     b->yy_is_our_buffer = 1;
  1129.  
  1130.     yy_init_buffer( b, file );
  1131.  
  1132.     return b;
  1133.     }
  1134.  
  1135.  
  1136. %-
  1137. #ifdef YY_USE_PROTOS
  1138. void yy_delete_buffer( YY_BUFFER_STATE b )
  1139. #else
  1140. void yy_delete_buffer( b )
  1141. YY_BUFFER_STATE b;
  1142. #endif
  1143. %+
  1144. void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
  1145. %*
  1146.     {
  1147.     if ( b == yy_current_buffer )
  1148.         yy_current_buffer = (YY_BUFFER_STATE) 0;
  1149.  
  1150.     if ( b->yy_is_our_buffer )
  1151.         yy_flex_free( (void *) b->yy_ch_buf );
  1152.  
  1153.     yy_flex_free( (void *) b );
  1154.     }
  1155.  
  1156.  
  1157. %-
  1158. #ifndef YY_ALWAYS_INTERACTIVE
  1159. #ifndef YY_NEVER_INTERACTIVE
  1160. extern int isatty YY_PROTO(( int ));
  1161. #endif
  1162. #endif
  1163.  
  1164. #ifdef YY_USE_PROTOS
  1165. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  1166. #else
  1167. void yy_init_buffer( b, file )
  1168. YY_BUFFER_STATE b;
  1169. FILE *file;
  1170. #endif
  1171.  
  1172. %+
  1173. extern "C" int isatty YY_PROTO(( int ));
  1174. void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
  1175. %*
  1176.  
  1177.     {
  1178.     yy_flush_buffer( b );
  1179.  
  1180.     b->yy_input_file = file;
  1181.     b->yy_fill_buffer = 1;
  1182.  
  1183. %-
  1184. #if YY_ALWAYS_INTERACTIVE
  1185.     b->yy_is_interactive = 1;
  1186. #else
  1187. #if YY_NEVER_INTERACTIVE
  1188.     b->yy_is_interactive = 0;
  1189. #else
  1190.     b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  1191. #endif
  1192. #endif
  1193. %+
  1194.     b->yy_is_interactive = 0;
  1195. %*
  1196.     }
  1197.  
  1198.  
  1199. %-
  1200. #ifdef YY_USE_PROTOS
  1201. void yy_flush_buffer( YY_BUFFER_STATE b )
  1202. #else
  1203. void yy_flush_buffer( b )
  1204. YY_BUFFER_STATE b;
  1205. #endif
  1206.  
  1207. %+
  1208. void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
  1209. %*
  1210.     {
  1211.     b->yy_n_chars = 0;
  1212.  
  1213.     /* We always need two end-of-buffer characters.  The first causes
  1214.      * a transition to the end-of-buffer state.  The second causes
  1215.      * a jam in that state.
  1216.      */
  1217.     b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1218.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1219.  
  1220.     b->yy_buf_pos = &b->yy_ch_buf[0];
  1221.  
  1222.     b->yy_at_bol = 1;
  1223.     b->yy_buffer_status = YY_BUFFER_NEW;
  1224.  
  1225.     if ( b == yy_current_buffer )
  1226.         yy_load_buffer_state();
  1227.     }
  1228. %*
  1229.  
  1230.  
  1231. #ifndef YY_NO_SCAN_BUFFER
  1232. %-
  1233. #ifdef YY_USE_PROTOS
  1234. YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
  1235. #else
  1236. YY_BUFFER_STATE yy_scan_buffer( base, size )
  1237. char *base;
  1238. yy_size_t size;
  1239. #endif
  1240.     {
  1241.     YY_BUFFER_STATE b;
  1242.  
  1243.     if ( size < 2 ||
  1244.          base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1245.          base[size-1] != YY_END_OF_BUFFER_CHAR )
  1246.         /* They forgot to leave room for the EOB's. */
  1247.         return 0;
  1248.  
  1249.     b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  1250.     if ( ! b )
  1251.         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1252.  
  1253.     b->yy_buf_size = size - 2;    /* "- 2" to take care of EOB's */
  1254.     b->yy_buf_pos = b->yy_ch_buf = base;
  1255.     b->yy_is_our_buffer = 0;
  1256.     b->yy_input_file = 0;
  1257.     b->yy_n_chars = b->yy_buf_size;
  1258.     b->yy_is_interactive = 0;
  1259.     b->yy_at_bol = 1;
  1260.     b->yy_fill_buffer = 0;
  1261.     b->yy_buffer_status = YY_BUFFER_NEW;
  1262.  
  1263.     yy_switch_to_buffer( b );
  1264.  
  1265.     return b;
  1266.     }
  1267. %*
  1268. #endif
  1269.  
  1270.  
  1271. #ifndef YY_NO_SCAN_STRING
  1272. %-
  1273. #ifdef YY_USE_PROTOS
  1274. YY_BUFFER_STATE yy_scan_string( const char *str )
  1275. #else
  1276. YY_BUFFER_STATE yy_scan_string( str )
  1277. const char *str;
  1278. #endif
  1279.     {
  1280.     int len;
  1281.     for ( len = 0; str[len]; ++len )
  1282.         ;
  1283.  
  1284.     return yy_scan_bytes( str, len );
  1285.     }
  1286. %*
  1287. #endif
  1288.  
  1289.  
  1290. #ifndef YY_NO_SCAN_BYTES
  1291. %-
  1292. #ifdef YY_USE_PROTOS
  1293. YY_BUFFER_STATE yy_scan_bytes( const char *bytes, int len )
  1294. #else
  1295. YY_BUFFER_STATE yy_scan_bytes( bytes, len )
  1296. const char *bytes;
  1297. int len;
  1298. #endif
  1299.     {
  1300.     YY_BUFFER_STATE b;
  1301.     char *buf;
  1302.     yy_size_t n;
  1303.     int i;
  1304.  
  1305.     /* Get memory for full buffer, including space for trailing EOB's. */
  1306.     n = len + 2;
  1307.     buf = (char *) yy_flex_alloc( n );
  1308.     if ( ! buf )
  1309.         YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1310.  
  1311.     for ( i = 0; i < len; ++i )
  1312.         buf[i] = bytes[i];
  1313.  
  1314.     buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
  1315.  
  1316.     b = yy_scan_buffer( buf, n );
  1317.     if ( ! b )
  1318.         YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1319.  
  1320.     /* It's okay to grow etc. this buffer, and we should throw it
  1321.      * away when we're done.
  1322.      */
  1323.     b->yy_is_our_buffer = 1;
  1324.  
  1325.     return b;
  1326.     }
  1327. %*
  1328. #endif
  1329.  
  1330.  
  1331. #ifndef YY_NO_PUSH_STATE
  1332. %-
  1333. #ifdef YY_USE_PROTOS
  1334. static void yy_push_state( int new_state )
  1335. #else
  1336. static void yy_push_state( new_state )
  1337. int new_state;
  1338. #endif
  1339. %+
  1340. void yyFlexLexer::yy_push_state( int new_state )
  1341. %*
  1342.     {
  1343.     if ( yy_start_stack_ptr >= yy_start_stack_depth )
  1344.         {
  1345.         yy_size_t new_size;
  1346.  
  1347.         yy_start_stack_depth += YY_START_STACK_INCR;
  1348.         new_size = yy_start_stack_depth * sizeof( int );
  1349.  
  1350.         if ( ! yy_start_stack )
  1351.             yy_start_stack = (int *) yy_flex_alloc( new_size );
  1352.  
  1353.         else
  1354.             yy_start_stack = (int *) yy_flex_realloc(
  1355.                     (void *) yy_start_stack, new_size );
  1356.  
  1357.         if ( ! yy_start_stack )
  1358.             YY_FATAL_ERROR(
  1359.             "out of memory expanding start-condition stack" );
  1360.         }
  1361.  
  1362.     yy_start_stack[yy_start_stack_ptr++] = YY_START;
  1363.  
  1364.     BEGIN(new_state);
  1365.     }
  1366. #endif
  1367.  
  1368.  
  1369. #ifndef YY_NO_POP_STATE
  1370. %-
  1371. static void yy_pop_state()
  1372. %+
  1373. void yyFlexLexer::yy_pop_state()
  1374. %*
  1375.     {
  1376.     if ( --yy_start_stack_ptr < 0 )
  1377.         YY_FATAL_ERROR( "start-condition stack underflow" );
  1378.  
  1379.     BEGIN(yy_start_stack[yy_start_stack_ptr]);
  1380.     }
  1381. #endif
  1382.  
  1383.  
  1384. #ifndef YY_NO_TOP_STATE
  1385. %-
  1386. static int yy_top_state()
  1387. %+
  1388. int yyFlexLexer::yy_top_state()
  1389. %*
  1390.     {
  1391.     return yy_start_stack[yy_start_stack_ptr - 1];
  1392.     }
  1393. #endif
  1394.  
  1395. #ifndef YY_EXIT_FAILURE
  1396. #define YY_EXIT_FAILURE 2
  1397. #endif
  1398.  
  1399. %-
  1400. #ifdef YY_USE_PROTOS
  1401. static void yy_fatal_error( const char msg[] )
  1402. #else
  1403. static void yy_fatal_error( msg )
  1404. char msg[];
  1405. #endif
  1406.     {
  1407.     (void) fprintf( stderr, "%s\n", msg );
  1408.     exit( YY_EXIT_FAILURE );
  1409.     }
  1410.  
  1411. %+
  1412.  
  1413. void yyFlexLexer::LexerError( const char msg[] )
  1414.     {
  1415.     cerr << msg << '\n';
  1416.     exit( YY_EXIT_FAILURE );
  1417.     }
  1418. %*
  1419.  
  1420.  
  1421. /* Redefine yyless() so it works in section 3 code. */
  1422.  
  1423. #undef yyless
  1424. #define yyless(n) \
  1425.     do \
  1426.         { \
  1427.         /* Undo effects of setting up yytext. */ \
  1428.         yytext[yyleng] = yy_hold_char; \
  1429.         yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
  1430.         yy_hold_char = *yy_c_buf_p; \
  1431.         *yy_c_buf_p = '\0'; \
  1432.         yyleng = n; \
  1433.         } \
  1434.     while ( 0 )
  1435.  
  1436.  
  1437. /* Internal utility routines. */
  1438.  
  1439. #ifndef yytext_ptr
  1440. #ifdef YY_USE_PROTOS
  1441. static void yy_flex_strncpy( char *s1, const char *s2, int n )
  1442. #else
  1443. static void yy_flex_strncpy( s1, s2, n )
  1444. char *s1;
  1445. const char *s2;
  1446. int n;
  1447. #endif
  1448.     {
  1449.     register int i;
  1450.     for ( i = 0; i < n; ++i )
  1451.         s1[i] = s2[i];
  1452.     }
  1453. #endif
  1454.  
  1455.  
  1456. #ifdef YY_USE_PROTOS
  1457. static void *yy_flex_alloc( yy_size_t size )
  1458. #else
  1459. static void *yy_flex_alloc( size )
  1460. yy_size_t size;
  1461. #endif
  1462.     {
  1463.     return (void *) malloc( size );
  1464.     }
  1465.  
  1466. #ifdef YY_USE_PROTOS
  1467. static void *yy_flex_realloc( void *ptr, yy_size_t size )
  1468. #else
  1469. static void *yy_flex_realloc( ptr, size )
  1470. void *ptr;
  1471. yy_size_t size;
  1472. #endif
  1473.     {
  1474.     return (void *) realloc( ptr, size );
  1475.     }
  1476.  
  1477. #ifdef YY_USE_PROTOS
  1478. static void yy_flex_free( void *ptr )
  1479. #else
  1480. static void yy_flex_free( ptr )
  1481. void *ptr;
  1482. #endif
  1483.     {
  1484.     free( ptr );
  1485.     }
  1486.  
  1487. #if YY_MAIN
  1488. int main()
  1489.     {
  1490.     yylex();
  1491.     return 0;
  1492.     }
  1493. #endif
  1494.